<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>我的推荐</title>
<link rel="stylesheet" type="text/css" href="/style/css/base.css"/>
<link rel="stylesheet" type="text/css" href="/style/css/topic.css?ver=20180806"/>
<link rel="stylesheet" type="text/css" href="/style/css/xshop.css?ver=20190412" />
<link rel="stylesheet" href="/style/css/iconfont.css">
<link rel="stylesheet prefetch" href="/style/css/photoswipe.css">
<link rel="stylesheet prefetch" href="/style/css/default-skin/default-skin.css">
<script src="/style/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/js/xShop.js" type="text/javascript" charset="utf-8"></script>
<style>
/*搜索*/

.nearby-search {
    position: absolute;
    width: 56%;
    left: 22%;
    background: #fff;
    border-radius: .32rem;
    height: .64rem;
    line-height: .64rem;
    margin-top: .12rem;
    float: left;
}
.icon-search {
    width: .3rem;
    height: .3rem;
    margin: .17rem .12rem 0 .2rem;
    float: left;
    background: url(../images/icon-search-gray.png) no-repeat;
    background-size: 100%;
}
.search-input {
    width: 76%!important;
    border: none!important;
    height: .64rem!important;
    line-height: .64rem!important;
    font-size: .26rem!important;
    color: #333!important;
    background-color: transparent!important;
    margin-bottom: 0!important;
    padding: 0!important;
    float: left;
}
.fenlei-search {
    background: #e80e1d;
    padding: .12rem .3rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999999;
}
.fenlei-search-inner {
    width: 6rem;
    position: relative;
    background: #fff;
    border-radius: .32rem;
    height: .64rem;
    line-height: .64rem;
    float: left;
}
.fenlei-search-icon {
    width: .3rem;
    height: .3rem;
    margin: .17rem .12rem 0 .2rem;
    float: left;
}
.fenlei-search-input {
    width: 83%!important;
    border: none!important;
    height: .64rem!important;
    line-height: .64rem!important;
    font-size: .26rem!important;
    color: #323232!important;
    background-color: transparent!important;
    margin-bottom: 0!important;
    padding: 0!important;
    float: left;
}
.fenlei-search-inner input:-ms-input-placeholder {
    color: #323232;
    opacity: 1;
}
.fenlei-search-inner input::-webkit-input-placeholder {
    color: #323232;
    opacity: 1;
}
.fenlei-search-inner input:-moz-placeholder {
    /* Mozilla Firefox 4 to 18 */
    color: #323232;
    opacity: 1;
}
.fenlei-search-inner input::-moz-placeholder {
    /* Mozilla Firefox 19+ */
    color: #323232;
    opacity: 1;
}
.fenlei-search-right {
    float: right;
    color: #fff;
    font-size: .28rem;
    line-height: .64rem;
	margin-right:.55rem;
}
.agent-upgrade{
	
    font-size: 0.3rem;
    color: #fff!important;
    background: #e80e1d;
    width: 1rem;
    height: 0.42rem;
    line-height: 0.52rem;
    text-align: center;
    border-radius: 0.40rem;
	padding: .1rem .3rem;
    margin-bottom:0.28rem;
	display:block;
	
}
ul li{
	
    overflow: hidden;
}
</style>
</head>
<body>
<div class="outwrap">
	<form id="forms" action="recommend" method="get">
	<div class="fenlei-search">
		<div class="fenlei-search-inner">
			<img class="fenlei-search-icon" src="/style/goodslist/d2.png"/>
			<input class="fenlei-search-input" id="_keywords" type="text" name="keyword"  placeholder="姓名/手机号码" value="<?=$_GET['keyword']?>"/>
		</div>
		<p class="fenlei-search-right" id="_search">搜索</p>
	</div>
	</form>
	<div class="screen-home screen-gz " style="margin-top:.88rem;">
		<div class="segmentation"></div>
		<div class="zt-list">
			<ul id="content">
			
			<?php if($this->data['data']){

                 foreach($this->data['data'] as $k=>$v){


                        if($v['mobile']=="")
                        {
                            $v['member_level'] = -1;
                        }
                ?>
				<li><a href="javascript:void();" class="clearfix">
					<div class="logo">
                        <?php if($v['headimgurl']){?>
                            <img src="<?=$v['headimgurl'];?>"/></div>
                        <?php } elseif($v['wechat_headimgurl']){ ?>
                        <img src="<?=$v['wechat_headimgurl'];?>"/></div>
                        <?php }else{?>
                         <img src="/style/images/img25.jpg"/></div>
                        <?php }?>
                       
					<div class="info">
						<h2 class="recommend-title"><?=$v['realname']?>(<?=$v['count']?>)                  
                           <div class="txt">
                           <?=$this->c['member_level'][$v['member_level']];?>
                           </div>                         
                        </h2>                      
						<p class="recommend-font">加入时间：<span class="mmore"><?=$v['create_time']?></span></p>
					</div>
					 </a> 
				<div style="margin-left:59px;">
				<p class="recommend-font"><span class="mmore"><a href="tel:<?=$v['mobile']?>>" style="color:#666;font-size:.3rem"><?=$v['name'];?> <?=$v['mobile']?></a>
				
				</span></p>
				</div>
				
				</li>
                <?php }
                }else{?>
                <div class="meinner-adr-add" style="background: #fff;">
                   <div class="screen">
                        <div class="screen-none-pic"><img src="/style/images/catkong-4.png" id="show-img"/></div>
                        <p class="screen-none-font" id="show-conts">您还没有推荐好友！</p>
                  </div>
                </div>
                <?php }?>
			</ul>
		</div>
	</div>
</div>
</body>
<script>
var _loading = false,
page=1,
_levle = <?=json_encode($this->c['member_level']);?>;
$(document).ready(function(e){

	$(".screen-gz").on("scroll",function(){
		
		if($(document).scrollTop() + $(window).height() + 200 >=$(document).height() && !_loading)
		{
			 page = parseInt(page) + 1;
		
	    	 _loading = true;
	         $.ajax({type:'GET',url:"/user/recommend?act=ajax&page="+page+"&keyword="+$('#_keywords').val(),dataType: "json", success: function(res) {
	        	 //alert(JSON.stringify(res));
	      		
	                    if(res.data.length >0){
		                   
	                        var htmlss = '';
	                        var img;
	                        var level;
	                       if(res.page<res.maxpage){
	                          
	                    	     _loading = false;
	                           }
	                     $.each(res.data,function(key,value){
	                              
	                               if(value.wechat_headimgurl !=''){
	                            	   img = '<img src="'+value.wechat_headimgurl+'"/>'; 
	                                 }else{
									   img = '<img src="/style/images/img25.jpg"/></div>';
	                                  }

                                      if(value.mobile=="" || value.mobile==null)
                                      {
                                        value.member_level = -1;
                                      }

	                            	level = '<div class="txt">'+_levle[value.member_level]+'</div>';
	                                

                                   var _name = '';

                                   if(value.name!="" && value.mobile!="")
                                   {
                                    _name = value.name+' '+value.mobile;
                                   }

	                               htmlss += '<li><a href="javascript:void();" class="clearfix">';
	                               htmlss += '<div class="logo">'+img+'</div>';
	                               htmlss +='<div class="info"><h2 class="recommend-title">'+value.realname+level+'</h2>';     
	                               htmlss +='<p class="recommend-font">加入时间：<span class="mmore">'+value.create_time+'</span></p></div></a>';
	                               htmlss +='<div style="margin-left:59px;"><p class="recommend-font"><span class="mmore"><a href="tel:'+value.mobile+'" style="color:#666;font-size:.3rem">'+_name+'</a></span></p></div></li>';
	                              
	                       });
	                        
	                       $('#content').append(htmlss);

	               
	                    }
	              }
	          });
		} 
	});

	
})
$("#_search").click(function(){
	
	   $("#forms").submit();    	
	   	
})
</script>
</html>
